﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace MS.Common.Infr.Migrations
{
    public partial class Add_User_ShangPin : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "BaoJian",
                columns: table => new
                {
                    BaoJianId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ShangPinId = table.Column<int>(type: "int", nullable: false),
                    BaoJianTianShu = table.Column<int>(type: "int", nullable: false),
                    BaoJianFangShi = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    BaoJianFanfFa = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_BaoJian", x => x.BaoJianId);
                });

            migrationBuilder.CreateTable(
                name: "DongJian",
                columns: table => new
                {
                    DongJianId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    DongJianImage = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_DongJian", x => x.DongJianId);
                });

            migrationBuilder.CreateTable(
                name: "JianYan",
                columns: table => new
                {
                    JianYanId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    JianYanImage = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_JianYan", x => x.JianYanId);
                });

            migrationBuilder.CreateTable(
                name: "QiYe",
                columns: table => new
                {
                    QiYeId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ShangPinId = table.Column<int>(type: "int", nullable: false),
                    QiYeName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    QiYeFuZe = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    QiYeShuLiang = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_QiYe", x => x.QiYeId);
                });

            migrationBuilder.CreateTable(
                name: "QiYeTu",
                columns: table => new
                {
                    QiYeTuId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    QiYeTuImage = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_QiYeTu", x => x.QiYeTuId);
                });

            migrationBuilder.CreateTable(
                name: "ShangPin",
                columns: table => new
                {
                    ShangPinId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ShangPinName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    ShangPinPiCi = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    ShangPinBaoZhi = table.Column<int>(type: "int", nullable: false),
                    ShangPinXuKe = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    ShangPinQiYe = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    ShangPinImage = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_ShangPin", x => x.ShangPinId);
                });

            migrationBuilder.CreateTable(
                name: "Users",
                columns: table => new
                {
                    UserId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    UserName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    UserPwd = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    UserType = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Users", x => x.UserId);
                });

            migrationBuilder.CreateTable(
                name: "YangZhi",
                columns: table => new
                {
                    YangZhiId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ShangPinId = table.Column<int>(type: "int", nullable: false),
                    YangZhiPinZhong = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    YangZhiLaiYuan = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    YangZhiTianShu = table.Column<int>(type: "int", nullable: false),
                    YangZhiPinPai = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    YangZhiFuZhe = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    YangZhiTime = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_YangZhi", x => x.YangZhiId);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "BaoJian");

            migrationBuilder.DropTable(
                name: "DongJian");

            migrationBuilder.DropTable(
                name: "JianYan");

            migrationBuilder.DropTable(
                name: "QiYe");

            migrationBuilder.DropTable(
                name: "QiYeTu");

            migrationBuilder.DropTable(
                name: "ShangPin");

            migrationBuilder.DropTable(
                name: "Users");

            migrationBuilder.DropTable(
                name: "YangZhi");
        }
    }
}
